package com.helloUIBinder.client.customComponents;

import com.google.gwt.user.client.ui.*;

public class DeleteDialogBox extends DialogBox {

    private Button closeButton;
    private Button okButton;

    public DeleteDialogBox() {
        setText("Delete");

        closeButton = new Button("Close");
        okButton = new Button("OK");
        HTML msg = new HTML("<center>Are you sure you want to delete this blog?</center>",true);

        DockPanel dock = new DockPanel();
        dock.setSpacing(4);

         HorizontalPanel buttonPanel = new HorizontalPanel();
        buttonPanel.setWidth("100%");

//        dock.add(closeButton, DockPanel.SOUTH);
//        dock.add(okButton, DockPanel.SOUTH);
        buttonPanel.add(okButton);
        buttonPanel.add(closeButton);
        buttonPanel.setCellHorizontalAlignment(closeButton, HorizontalPanel.ALIGN_RIGHT);
        buttonPanel.setCellHorizontalAlignment(okButton, HorizontalPanel.ALIGN_LEFT);

        dock.add(buttonPanel, DockPanel.SOUTH);

        dock.add(msg, DockPanel.CENTER);
        Image image = new Image("img/delete.png");
        dock.add(image, DockPanel.NORTH);

//        dock.setCellHorizontalAlignment(closeButton, DockPanel.ALIGN_RIGHT);
//        dock.setCellHorizontalAlignment(okButton, DockPanel.ALIGN_LEFT);

        dock.setCellHorizontalAlignment(image, DockPanel.ALIGN_CENTER);

        dock.setWidth("100%");
        setWidget(dock);
    }

    public Button getCloseButton() {
        return closeButton;
    }

    public Button getOkButton() {
        return okButton;
    }
}
